import req from "../utils/http.js"
//课题列表
export function getProjectList(){
    const parmt = {
        "enable": 1
    }
    return req.post(`/api/weChat/applet/subject/list`,parmt)
}
// 账号密码登录
export function getAccountLogin(username,password) {
    let parms = new URLSearchParams()
    parms.append("username", username)
    parms.append("password", password)
    parms.append("rememberMe",true)
    return req.post(`/api/pcUser/login`,parms)
}
// 手机登录获取手机验证码
export function getLoginPhoneCode(mobile) {
    return req.get(`/api/pcUser/login/send/code/${mobile}`,)
}
// 注册接口
export function getRegisteredInterFace(loginName,code,mobile,password,nickname) {
    let parms = new URLSearchParams()
    parms.append("loginName", loginName)
    parms.append("code", code)
    parms.append("mobile",mobile)
    parms.append("password",password)
    parms.append("nickname",nickname)
    return req.post(`/api/pcUser/register`,parms)
}
// 获取注册验证码
export function getRegisterPhoneCode(phoneNum) {
    return req.get(`/api/pcUser/register/send/code/${phoneNum}`)
}
// 根据课程类型获取列表（搜索页)
export function getCourseList(type,pageNum,pageSize){
    const parmt= new URLSearchParams
    parmt.append('type',type)
    parmt.append('pageNum',pageNum)
    parmt.append('pageSize',pageSize)
    return req.post(`/api/weChat/applet/course/list/type`,parmt)
}

export function getkeyord(type,pageNum,pageSize){
    const parmt= new URLSearchParams
    parmt.append('type',type)
    parmt.append('pageNum',pageNum)
    parmt.append('pageSize',pageSize)
    return req.post(`/api/weChat/applet/course/list/type`,parmt)
}
//缓冲页

export function getbuffer(courseId){
    return req.get(`/api/pc/course/detail/${courseId}`)
}